<?php
class Myh_Validate_Captcha extends Zend_Validate_Abstract
{
	const NOT_EQUAL = 'notEqual';
	
    protected $_captcha;
    /**
     * @var array
     */
    protected $_messageTemplates = array(
        self::NOT_EQUAL => "'Captcha is Invalid'",
    );
    public function __construct($captchaID){
    	$this->_captcha = $captchaID;
    }
    public function isValid($value){
    	$captchass = new Zend_Session_Namespace('Zend_Form_Captcha_' .$this->_captcha);
    	if(strcmp($value,$captchass->word) != 0){
    		$this->_error('notEqual');
    		return false;
    	}
    	return true;
    }
}